<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>生成HTML</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script language="javascript">
function SelectTemplets(fname)
{
   if(document.all){
     var posLeft = window.event.clientY-100;
     var posTop = window.event.clientX-400;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
   window.open("../include/dialog/select_templets.php?&activepath=<?php echo urlencode($cfg_templets_dir.'/plus')?>&f="+fname, "poptempWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
}
</script>
</head>
<body background="images/allbg.gif" leftmargin="8" topmargin="8">
<table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" align="center">
  <form name="form1" action="makehtml_html_action.php" method="get" target='stafrm'>
  <input type="hidden" value="<?php echo $row['templetType']?>" name="templetType" id="templetType" />
   <input type="hidden" value="<?php echo $id?>" name="sectionid" id="sectionid" />

  
    <tr> 
      <td height="28" colspan="2" background='images/tbg.gif'> <table width="98%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="30%" height="18" style="padding-left:10px;"><strong>获取栏目HTML文件：</strong></td>
            <td width="70%" align="right"><a href="catalog_main.php"><u>栏目管理</u></a> 
            </td>
          </tr>
        </table></td>
    </tr>
    <tr> 
      <td width="108" valign="top" bgcolor="#FFFFFF">选择栏目：</td>
      <td width="377" valign="top" bgcolor="#FFFFFF"> 
        <?php
       if(empty($cid)) $cid="0";
       $tl = new TypeLink($cid);
       $typeOptions = $tl->GetOptionArray($cid,$admin_catalogs,0,1);
       echo "<select name='typeid' style='width:300'>\r\n";
       if($cid=="0") echo "<option value='0' selected>所有栏目...</option>\r\n";
       echo $typeOptions;
       echo "</select>";
		?>
      </td>
    </tr>
	<tr> 
      <td height="20" valign="top" bgcolor="#FFFFFF">区块名称：</td>
      <td height="20" valign="top" bgcolor="#FFFFFF">
	   <font color="red"> <?php echo $row['sectionname']?></font>
	  </td>
    </tr>
  <?php 
  if($row['templetType']=="1")
  {
		echo '<tr>';
		echo '  <td height="20" valign="top" bgcolor="#FFFFFF">模板文件：</td>';
		echo '  <td height="20" valign="top" bgcolor="#FFFFFF">';
		echo '   <input name="templet" type="text" id="templet" style="width:300px" value='.$row['templet'].' /> ';
		echo '  <input type="button" name="set4" value="浏览..." style="width:60" onClick=SelectTemplets("form1.templet");> ';
		echo ' </td>    </tr>';
  
  }?>
  <?php 
  if($row['templetType']=="0")
  {  
	 echo '<tr>';
      echo '<td height="20" valign="top" bgcolor="#FFFFFF">代码类型：</td>';
     echo ' <td height="20" valign="top" bgcolor="#FFFFFF">';
	  echo '  <textarea name="phpcode" id="phpcode" style="width:70%;height:100px">'.html2text($row['phpcode']).'</textarea>';
     echo ' </td>    </tr>';
 }?>
    <tr>
      <td height="20" valign="top" bgcolor="#FFFFFF">生成文件路径</td>
      <td height="20" valign="top" bgcolor="#FFFFFF">
       <input name="filedir" type="text" id="filedir" style="width:35%" value="<?php echo $row['filedir'].'/'.$row['defaultpage']?>">
           其中<font color="red"> {id} </font>栏目编号            
      </td>
    </tr> 
    <tr> 
      <td height="20" valign="top" bgcolor="#FFFFFF">更新选项：</td>
      <td height="20" valign="top" bgcolor="#FFFFFF">
	    <input type="radio" name="uptype" value="all" class="np" checked>
        更新所有栏目 
        <input name="uptype" type="radio" value="onlyme" class="np" >
        仅当前文件
	  </td>
    </tr>
    <tr> 
      <td height="20" colspan="2" bgcolor="#ffffff" align="center">
      	<input name="b112" type="button" class="coolbg np" value="生成/更新HTML文件" onClick="document.form1.submit();" style="width:120px">
        <?php 
            if($cfg_remote_site=='Y')
            {
          ?> 　
             <input name="isremote" type="checkbox" id="isremote" value="1">是否同步远程发发布
             <?php GetFtp();?>
          <?php }?>  
      </td>
    </tr>
  </form>
  <tr bgcolor="#F9FCEF"> 
    <td height="20" colspan="2"> <table width="100%">
        <tr> 
          <td width="74%">进行状态： </td>
          <td width="26%" align="right"> <script language='javascript'>
            	function ResizeDiv(obj,ty)
            	{
            		if(ty=="+") document.all[obj].style.pixelHeight += 50;
            		else if(document.all[obj].style.pixelHeight>80) document.all[obj].style.pixelHeight = document.all[obj].style.pixelHeight - 50;
            	}
            	</script>
            [<a href='#' onClick="ResizeDiv('mdv','+');">增大</a>] [<a href='#' onClick="ResizeDiv('mdv','-');">缩小</a>] 
          </td>
        </tr>
      </table></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td colspan="2" id="mtd">
    	<div id='mdv' style='width:100%;height:350px;'> 
        <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
      </div>
     </td>
  </tr>
</table>
</body>
</html>
